<head>
    <meta charset="UTF-8">
<title>算法提高 计算器</title>
<link rel="stylesheet" href="../css/main.css">
</head>
 <p><b>【问题描述】</b></p>
<p>&nbsp;王小二的计算器上面的LED显示屏坏掉了，于是他找到了在计算器维修与应用系学习的你来为他修计算器。</p>
<p>屏幕上可以显示0~9的数字，其中每个数字由7个小二极管组成，各个数字对应的表示方式如图所示：</p>
<p><img width="426" height="77" alt="" src="http://lx.lanqiao.cn/RequireFile.do?fid=aYT2ERHR" /></p>
<p>&nbsp;。</p>
<p>&nbsp;</p>
<p>为了排除电路故障，现在你需要计算，将数字A变为数字B需要经过多少次变换？</p>
<p><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">注意：现在将其中每段小二极管的开和关都定义为一次变换。例如数字</span><span lang="EN-US">1</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">变为</span><span lang="EN-US">2</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">是</span><span lang="EN-US">5</span><span style="font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">次操作。</span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><font class="Apple-style-span" face="Candara"><b>【输入格式】</b></font></p>
<p class="MsoNormal"><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">&nbsp; &nbsp; &nbsp;第一行为一个正整数</span><span lang="EN-US">L</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">，表示数码的长度。</span></p>
<p class="MsoNormal" style="text-indent:21.75pt"><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">接下来两行是两个长度为</span><span lang="EN-US">L</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">的数字</span><span lang="EN-US">A</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">和</span><span lang="EN-US">B</span><span style="font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，表示要把数字</span><span lang="EN-US">A</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">变成数字</span><span lang="EN-US">B</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">（数字可以以</span><span lang="EN-US">0</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">开头）。</span></p>
<p class="MsoNormal"><font class="Apple-style-span" face="Candara"><b>【输出格式】</b></font></p>
<p class="MsoNormal"><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">&nbsp; &nbsp; &nbsp;一行一个整数，表示这些</span>小二极管一<span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">共要变换多少次。</span></p>
<p class="MsoNormal"><b>【样例输入1】</b></p>
<p class="MsoNormal" style="text-indent:21.75pt">&nbsp;</p>
<p class="MsoNormal">3</p>
<p class="MsoNormal"><span lang="EN-US">101</span></p>
<p class="MsoNormal"><span lang="EN-US">025</span></p>
<p class="MsoNormal"><b>【样例输出1】</b></p>
<p class="MsoNormal">12</p>
<p class="MsoNormal"><span lang="EN-US"><o:p><b>&nbsp;【样例输入2】</b></o:p></span><font class="Apple-style-span" face="Candara"><b><br />
</b></font></p>
<p class="MsoNormal"><span lang="EN-US">8</span></p>
<p class="MsoNormal"><span lang="EN-US">19920513</span></p>
<p class="MsoNormal">20111211</p>
<p class="MsoNormal"><font class="Apple-style-span"><b>【样例输出2</b></font><b><font class="Apple-style-span">】</font></b></p>
<p class="MsoNormal">27</p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b style="mso-bidi-font-weight:normal"><span style="font-family:宋体;mso-ascii-font-family:Candara;mso-hansi-font-family:Candara">【数据范围】</span></b></p>
<p class="MsoNormal">L&lt;=100</p>
<p>&nbsp;</p>
<p>&nbsp;</p>